<template>
  <div>
    <Modal :value="visible"
           @on-visible-change="onChangeVisible"
           footer-hide
           :z-index="900"
           fullscreen>
      <div class="car-popup noScroll">
        <div class="car-popup-title">
          {{title}}
          <Icon custom="i-icon icon-guanbi"
                size="26"
                color="#a0a0a0"
                class="car-popup-title-icon"
                @click.stop="onClickCancel" />
        </div>
        <div class="car-popup-cont noScroll">
          <!-- <div class="car-popup-cont-left">
            <slot name="left"></slot>
          </div>
          <div class="car-popup-cont-right">
            <slot name="right"></slot>
          </div> -->
          <slot></slot>
        </div>
      </div>
    </Modal>
  </div>
</template>

<script>
export default {
  model: {
    prop: 'visible',
    event: 'onChange'
  },
  props: {
    title: String,
    visible: Boolean
  },
  data () {
    return {

    }
  },
  methods: {
    onClickCancel () {
      this.$emit('onClickCancel')
      this.$emit('onChange', false)
    },
    onChangeVisible (boo) {
      if (!boo) {
        this.$emit('onChange', false)
      }
    },
  }
}
</script>

<style lang="scss" scoped>
.car-popup {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 600;
  padding-top: 110px;
  padding-bottom: 10px;
  background: rgba(25, 34, 41, 0.95);
  background-image: url(../../../../assets/main/carbg_left.png),
    url(../../../../assets/main/carbg_right.png);
  background-position: left center, right center;
  background-repeat: no-repeat;
  .car-popup-title {
    background-image: url(../../../../assets/main/carbg_top.png);
    background-size: 100% 100px;
    background-repeat: no-repeat;
    width: 100%;
    height: 100px;
    line-height: 100px;
    padding: 0 20px 10px;
    box-sizing: border-box;
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    color: #eee;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    .car-popup-title-icon {
      position: absolute;
      top: 20px;
      right: 10px;
      cursor: pointer;
    }
  }
  .car-popup-cont {
    height: 100%;
    min-width: 1350px;
    display: flex;
    justify-content: center;
    overflow: auto;
  }
}
</style>
